/*
 * =====================================================================================
 *
 *       Filename:  libutil.h
 *
 *    Description:  
 *
 *        Version:  1.0
 *        Created:  2012-10-01
 *       Revision:  none
 *       Compiler:  cmake & gcc
 *
 *         Author:  ankjt
 *
 * =====================================================================================
 */

#ifndef _LIBUTIL_H_
#define _LIBUTIL_H_

#include <stdio.h>

/* for pidfile.c */
struct pidfh
{
    int     pf_fd;
    char    pf_path[1025];
    __dev_t pf_dev;
    ino_t   pf_ino;
};

int             flopen(const char *_path, int _flags, ...);
struct pidfh*   pidfile_open(const char *path, mode_t mode, pid_t *pidptr);
int             pidfile_write(struct pidfh *pfh);
int             pidfile_close(struct pidfh *pfh);
int             pidfile_remove(struct pidfh *pfh);

#endif /* !_LIBUTIL_H_ */
